﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>个人信息 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<style type="text/css">
		@CHARSET "UTF-8";
	html,body{/*html for FF Moz NS7 OP */
	/*text-align:center; IE 5 IE 5.5*/
	margin:0;/* no margins body */
	padding:0;/* no padding body */
	height:100%;
	width:100%;
	background:transparent;
	font-size:13px;
	}



tr { height:35px;}
td{vertical-align:top;}
	</style>

</head>


<body style="margin:0px;padding:0px">

<?php
$db = include('./Application/Common/Conf/config.php');  

$host =  $db['DB_HOST'];
$port =  $db['DB_PORT'];
$dbname =  $db['DB_NAME'];
$user =  $db['DB_USER'];
$psw =  $db['DB_PWD'];
$dbconn = pg_connect("host=$host port=$port dbname=$dbname user=$user password=$psw");
 if($dbconn)
 {
   $userId =  $_GET['userid'];
   if(!empty($userId)){
   $sql = "select calias,nuserid,csign,nage,ngender,ccity,cprovince,ccountry,cdesc,nxingzuo,nbirthday from tbuserinformation where nuserid=$userId;";
   $R = pg_query($dbconn,$sql);
   $userInfor = pg_fetch_array($R);
  
    if(!$userInfor['nuserid']){
	 $userInfor = array(
			'calias'=>$userId,
			'nuserid'=>$userId,
			'csign'=>'',
			'ngender'=>2,
			'ccity'=>'',
			'cprovince'=>'',
			'ccountry'=>'',
			'cdesc'=>'',
			'nxingzuo'=>'',
			'nbirthday'=>''									
	 );
	      
	 }else{
		
		$Allxingzuo = array('白羊','金牛','双子','巨蟹','狮子','处女','天秤','天蝎','射手','魔蝎','水瓶','双鱼');
		$xingzuo =$Allxingzuo[$userInfor['nxingzuo']]; 
		$userInfor['nxingzuo'] = $xingzuo;
		
		if($userInfor['nbirthday']){
		 $month = floor(($userInfor['nbirthday']%10000)/100);
		$day = $userInfor['nbirthday']%100;
		$birth=$month.'月'.$day.'日';	
		$userInfor['nbirthday'] =$birth;
		}
		
		
		
	 
	 }
   }
 }else
 {
   echo "the databse isn't connected";
 }
?>

<table cellspacing="0" cellpadding="0" border="0" width="350">

<tr>
<td>昵称：</td>
<td><?php echo $userInfor['calias'];?></td>
</tr>
<tr>
<td>账号：</td>
<td><?php echo $userInfor['nuserid'];?></td>
</tr>
<tr>
<td>等级：</td>
<td colspan="3">0</td>
</tr>
<tr>
<td>签名：</td>
<td colspan="3"><?php echo $userInfor['csign'];?></td>
</tr>
<tr>
<td>性别：</td>
<td  width="50%">
<?php if($userInfor['ngender']==0){echo '女';}
	 if($userInfor['ngender']==1){echo '男';}?>
</td>
<td>星座：</td>
<td><?php if($userInfor['nxingzuo']){
echo $userInfor['nxingzuo']."座";
};?></td>
</tr>
<tr>
<td>年龄：</td>

<td>
	<?php if($userInfor['nage']){
	 echo $userInfor['nage']."岁";
	};?>
</td>
<td style="width:13%">生日：</td>
<td><?php echo $userInfor['nbirthday'];?></td>
</tr>
<tr>
<td width="17%">所在地：</td>
<td colspan="3"><?php echo $userInfor['ccountry'];?>&nbsp;<?php echo $userInfor['cprovince'];?>&nbsp;<?php echo $userInfor['ccity'];?></td>

</tr>
<tr>
<td>说明：</td>
<td colspan="3"><?php echo $userInfor['cdesc'];?></td>

</tr>
</table>




</body>
</html>